Refactoring: define sort predicate in controller instead of view.