Wrapped data with shared_ptr to prevent memory leak