Added hooks
Improved hooks, better API