Hooks refactor

Addresses #258.