Amends c1701948. Sorry, I missed to stage and apply this chunk while continuing to develop on a feature branch on top of this refactoring. (cherry picked from commit 5110f1b4)