This reverts commit 059b68dd67. Note that this was manually adjusted to retain some of the refactoring introduced by commit 059b68dd67, so that it could likewise retain the correction introduced in commit 5b4bc05fa5
059b68dd67
5b4bc05fa5