This is cleaner, but it means doing "instanceof" checks every time the transform is run, rather than once at transform construction time.   Matter of fact I wrote almost this exact code, and then refactored it into the mess you see now.  ;)

The general approach that I take is to assume that Chainr instances will be created and then reused, hence I try to push as much heavy lifting into the construction / parsing of the Transforms.

The down side in this particular instance is that it is kinda ugly.