start of mongo refactor