refactored the template files.