remove old references from template