public async Task ProcessNext()
        {
            var nextItm = await _exportAccessor.GetNextOpenItem();

            var lastId = await _directoryAccessor.GetLastId();

            if (nextItm == null)
            {
                return;
            }

            var cached = _cache.GetCachedExport(nextItm.ExportType);

            if (cached != null && cached.End >= lastId)
            {
                await SendResultEmail(nextItm, cached.Data);
            }

            //TODO: if we have most of the data cached already, shouldnt we just
            //TODO: append whats new to this rather than creating it all again?

            nextItm.Status = ExportStatus.Started;
            await _exportAccessor.UpdateItem(nextItm);

            var zip = new byte[0];

            using (var dt = CreateDataTable())
            {
                foreach (var chunk in ChunkRanges(nextItm.StartRange, lastId))
                {
                    foreach (var row in await _directoryAccessor.GetSubmisionsInRange(chunk.start, chunk.end))
                    {
                        AddRow(dt, row);
                    }
                }

                zip = await CompressExcelFile(dt, nextItm.ExportType.ToString());
            }

            nextItm.Status = ExportStatus.ExcelBuilt;
            await _exportAccessor.UpdateItem(nextItm);

            await _cache.CacheExport(nextItm.ExportType, new CompressedResult
            {
                Start = nextItm.StartRange,
                End   = lastId,
                Data  = zip
            });

            await SendResultEmail(nextItm, zip);

            nextItm.Status = ExportStatus.Finished;
            await _exportAccessor.UpdateItem(nextItm);
        }