use StringBuilder instead of StringBuffer
remove unnecessary brackets around StringBuilder constructor
pass char instead of String to StringBuilder/StringBuffer where appropriate
small optimization