exercise 1 refactoring