misc
Not too much functions, move hook implementations back to main module file.