Code cleanup and optimization

- Removed unused usings
- Converted if statements to switch (performance optimization)
Code cleanup and optimazation

See previous commit