refactoring problem 4