Refactor part 1
Refactor part 2