Code improvments

- Removed unused usings
- Converted if statements to switch (performance optimization)

There are no "real" changes.
Just some better code formatting and some refactoring.

Would be nice if you can test this again with R28 and R30