removed old toHtml method