Move the before_destroy callback out