Wild idea: can we use streams for this? I have plans to augment the streams api, which would maybe make stuff like this easier to generate.