almost done; last issue remaining: purge metadata on delete