Replace std::shared_ptr with pointer and make the constructor explicit