Refactor Lab 6.2 (simplify .each-do)