Refactor create_teams

Smaller methods, more tests.