Changing all string literal based `switch` statements to `if/else` for optimal performance

Reverting a change to validate.test