rm some uses of to_mut_unsafe_ptr