add reference counting to Base class