further mongodb integration, minor style changes