Move computation for number of teams outside helper function