refactoring exercise answer