How to simplify these switch statement?

Printable View