Improved the name generation for each node type