Move hooks to separate method