Refactoring the code in DataTeam.php