Start of (untested) implementation of hooks