This signature is a bit of a handful in order to make it testable. Wouldn't object to writing the test data to S3 instead.