Refactored NodeVisitor from abstract class to interface