Follow Split `index.js` to separate files (#17315) It's time to move some code away from the messy "legacy" file.