refactors the datastore case into callable datastore methods