some clean up, and bug fix for checking a team exists