refactor part2