refactor part 10