added little support on StringBuffer, and some fixes and refactors