refactor to make all the query classes private