removing metadata and tempfiles