reference count and copy on write