handleNodeWithTeam is now a local function, not a member.