QSharedPointer refactor