perhaps move this into spark storagelevle itself.