Better abstraction for the shared ref counter