Allow to customize the controller callable.

Adds an optional callback that can be used to customize the controller callable that gets created.