Refactor exercise 1.3