Refactoring
Fix name and template logic