modify to be extensible with datastore other than in-memory