Refactoring updateEditorAndExecuteCode method a bit more
QueryAll is the same function for document or any other node