rename register_hook to just hook, for consistency with the perl