General refactor and addition of Amazon S3 Output