improve readability of to_s3 script