implemented template registration without refactoring