Adding s3 mojo, refactoring