refactor part 6