separate class for the query