Example 5 refactoring