improved Hooks API