Created the replace method on the DependencyInjection object.