Introduce skipRefs and onlyRefs to limit the scope of the hook