refactoring part 3