issue #21672: And more refactoring.