Refactor the HTML to remove duplication.