refactoring part 2