replace raw ptrs with std::unique_ptr<> in Prepare
replace shared_ptrs with std::unique_ptr<> in Prepare