Remove duplicate content from html and add to template.