refactoring part 1 done