Update to use the new hook system