Changed QueryGenerator structure