refactor mongodb into singleton class, not finished