Change the hook functions to use references.