refactor teams table