final version of QueryExecutor