refactoring NodeVisitor