Cleanup old code path and buggy behavior in the hook related methods
Merge pull request #471 from SBoudrias/hookCleanup

Refactor hooks related methods