Refactored to use Autofac