Refactored for datacosmos.