Improved hooks
Improve hook definition
Adding tests for new hooking features