Use switch case instead of if-else