Use a switch case instead of if