ioc as function