Refactor HtmlBodyBuilder to match types sent in by the IndexHandler.