Of/ioc refactor