Remove unused fields in templates