add visitor interface, unify the node type, use pointer in all places