refactored code for the subteam pages