Understanding DI and IoC