[WIP] Validate hooks existence

I think using `Pathname` may simplify this code. Did already consider using it?