fix and simplify smc_do