Replacing elseifs with a switch case.