Refactored to use Morphia