refactor part 8