Replaced bits of code with IoC.
Replaced bits of code with IoC.