I think it's better to have a proper switch statement in these cases. Switch is sometimes faster that if.. elseif ... and also this is what it  does.