Added hooks back again. Unit tests yet to come.