https://github.com/spumko/hapi/blob/master/lib/proxy.js#L15-L17 is what I mean. The function that takes configuration and returns the actual handler function. See how this one is doing a little bit schema validation? That's where the rest of it should move.