Some refactoring of the data store