refactored out s3