How can I simplify my code when checking if a map has a key?

That makes sense. In that case, why not make use of the value by converting it into a logic type, and including all players inside the map. Then you can set the logic value to true or false if you want to eliminate them or not.