Improving Generate::generateHooks