Move the after_destroy callback out