refdb - abstract reference reading/writing