Moved HTML output into templates.