Better hooking strategy

I simply changed the location where some of the hooks are set, so they don't need to be set again and again each time a package is loaded.