refactoring for different implementatinons, add mongo implementation for addb