refactor part 3