Minor fix - Small speed improvements

- Replaced if-else spaghetti with a switch.
- Replaced doubly-quoted strings by singly-quoted.