refactoring template