Refactored StringBuffer to use StringBuilder.