updated hook system to yield a thunk