refactor part 12