Maybe it's better to move the branch out of the iter.map.