refactor

* use StringBuilder instead of StringBuffer for speed
* use HashMap instead of Hashtable for speed
* remove all warnings with -source 1.6