Some code simplifications

* Use switch for strings instead of repeated ifs
* Reduce visibility of methods as much as possible
* Make methods static if they do static things