refactor part 7