Support for s3 file handling
Refactor s3 support