cleanup metadata etc.