removing a bunch of hardcoded switch cases