Implemented name generation for templates