How To Refactor for Dependency Injection, Part 1: Cleaning Up May 20, 2014 Take control of your application’s behavior and move toward dependency injection by refactoring your existing code.