refactored part two