begin refactoring: adding IOC support