replace if statement to switch

I think this is more readable