minor refactoring for sms sample app.