raw thin implementation with hooks