refactoring problem 1