Refactoring SMS Gateway