refractored s3