refactored template files