Replaced raw pointer with std::unique_ptr