remove nested document templates