Switched factories to DI/IoC