Refactoring template method