Dependency Injection added to the code.