To help with #15595 changes, refactoring is required. In this PR we switch from config to env vars. Doing some cleanup meanwhile.