refactoring part 2
refactoring part 3