refactored S3Connections.java