Cleanup of some code to remove dependency on Amazon S3