more work on modes and hooks