Tidy up Textmarketer code