Refactor HookManager.jsm