Added generic DestructorHook class