CORE-4270: a little refactoring in preparation for feature flags