Refactoring of queryData/queryNodes