Revert "Some performance optimizations by using switch() wherever possible instead of lengthy else if chains, one check versus more. Should be good."

This reverts commit 7a15916ea9357392845fa0b20b258c20d6a6566c.