refactoring problem 9