Move group creation logic into Example class