code tidyup for ioc