Hook refactor squash

Redo of #261.