simplifying the query building