Adapt code to new hooks.