Refactoring code that accesses external services
The article shows how to refactor code that mixes YouTube access, data translation, and domain logic into separate connection, gateway, domain, and coordinator objects, using small behavior-preserving steps and tests.