One is to have the outer code be the framework that takes a single path, and the inner code does the specific stuff. A FeatureFlagEnabled instance does one thing; a FeatureFlagDiabled does another.
Unfortunately, it's easier to sprinkle if-then around instead of rearchitecting. Not to mention having to handle combinations of feature flags since, for one reason or another, deprecation takes its own rework.