[CLEANUP] Use switch instead of multiple ifs.