configuring factory and IoC