I'm making a datapack where if you kill somebody they join your team, I already know how to track deaths and kills and I thought of making two scores, one is death count and the other is kills. If a kill happened, the game would just check which player has the score.
The problem with this is there will be at the start a team for every player, and the teams might move a lot, and making as much as 16 execute command makes me think that there might be a better way. Also this way I would need to make ±16 functions just to add the player then reset the scoreboards of death/kill, and if two players would die at once it could screw up the entire system.