Refactor S3 tests