Refined doc deletion cleanup (ref/refBy)