refactor methods and remove a subclass of QueryContext