First working version, hooks tbd