Refactored non-pymongo stuff out of Model.