Template refactoring (lesson 4)