Manage configuration in a block

* Define configuration in a block, not as arguments to the client
I know what you mean, but I can't think of anything better, and the helper methods you've defined at least make it clear what this code is doing.