This needs to be further thought through, but I think `shared_ptr` is a better way to manage object's lifetime. Alternative: can it be done with a move semantics? Should it?