refactor mod_sms