That's looks pretty good. But only extracting the factory class brings almost no improvement. Sure, testability is improved which is a good thing. But now we could solve the problem to configure the Faraday connection from the outside. I would suggest to pass the factory class into the constructor:

```ruby
def initialize(api_string, database_name, options = {})
  faraday_factory = options.delete(:faraday_factory) || FaradayFactory
  @connection = faraday_factory.create_connection()
end
```