Use a switch instead of an if-else chain.