Use a switch statement instead of many ifs.