performance enhancement: replaced StringBuffer with StringBuilder