started template refactoring