slightly optimization of the HTMLString method