Chapter4: code refactoring in solution 4-3