Refactor to support autofac better.