Move code from idh to smc