backport lazy_load_hooks