Move hooks to separate file