Move the filtering functionality that currently exists inside the controllers to the models themselves.