Co-authored-by: silverwind <me@silverwind.io>
just a step towards #25655 and some related refactoring
Replace #20480 Replace #18448 Close #16414