Change AppKernel to work with mongodb