Make HOOK and UNHOOK functions universal