PS: I still find this whole approach a bit unsatisfactory, but this is a useful improvement while we search for a better solution.