Start using shared_ptr for better memory management.