Added in the hooks
Moved hooks to lib folder