refactor part 1
refactor part 2