added class QueryFactory