Refactored clickatell code to be closer to Twilio