Exercise on refactoring 1st chapter