moved hooks to a separate file