Added a query helper method.