Replaced some shared_ptr with raw pointers