Moved mongo db initialization to separate method