Refactored to remove deprecated CarbonContext API methods