Would be nice to push this block of login into a method.  Then it can be unit tested, and line 97 below could follow the more idiomatic style of:
 ```ruby
@services[service_name] ||= new_method(service_name)
```