refactor part 9