refactored loading of datastores too