Refactoring some of the early code in the storage package.