Begun refactoring of ASTQuery