Cleanup data before insertion to mongodb