Refactor part 1