Break testHtml() out into separate function