switch to std::shared_ptr