Finalizing changes to mongoDB functions and cleaning up dir structure