Move hooks to separate file/class

Change-Id: I20105bd57554c29158b1f64dd6455d3776e95791