Move next_xxx_hook definitions near the hook functions