refactoring CarbonContext usage