Collections lesson refactor