Code cleanup of res_smdi