added some data cleanup functions