Add hooks.

cc @asvirsky