collect sorting logic in single class