Refactored code to use Autofac for Dependency Injection