Abstracted sort filter from view to controller