re-structure, add logging to MongoDb