refactoring CARBON-14837 fix