refact ioc