Remove unnecessary code from template.