Adapt the hooks handler to the new approach.