refactored StringBuffer