Writing the clean output to S3