more refactoring to make team views a bit nicer