refactoring to node_generator