Enhance threadsafety of Hooks and improve generally