I wrote some random potential improvements here: #269931