As a follow up. I think the method provided here #12609 is superior to this approach.