I was changing the behaviour of this controller, and wondered if there was some way to make it less branchy and more self-documenenting.
I remembered an idea of Dave Thomas's - thinking about programs as series of transforms - and tried to apply it.
Which do you prefer?