WIP middleware support for the init callback.