This condition seems the same in all cases (I only view it in the GitHub web view, so can't really say for sure). Why not pull it out in front of the switch() statement? Also, because there's a "return" statement in it, it doesn't really need the "else"