moving collection sort/filtering to a query object