encapsulating some more storage code