@snoe I sent a PR that's a pretty rough sketch of a refactor. I'm happy to have it rejected for incompleteness or bad-ideaness.
@eraserhd thx, did a quick review I think the approach works.