added performance improvements to mongodb usage