added datastore classes, minor cleaning up