public void WriteFile(string filename, IEnumerable <Customer> customers, int batchSize) { var temp = _duplicateOptions.Apply(customers); var batched = SplitBatches(temp, batchSize); int fileNo = 1; foreach (var list in batched) { _csvWriter.WriteFile(filename + fileNo, list); fileNo++; } }