Made the code on the mongo adapter more readable.