refactored blob storage code