Completing exercise 1, refactorizing challenge 1