refactoring smscontroller
refactored deletion code