sortBy refactored so that only one field is possible