replace StringBuffer with StringBuilder when instance is nor shared