updated mainIr to use class factories