refactoring part1