Modify unsafe_unlink_events to use new setup
Declare instance_* functions