Refator to reduce duplication in HTML files.