added methods to apply orders and filters to queries