Generic hooks implementation, in theory