Abstracted common bits out from local / s3.