re-arrange AddTXTRecord code to make it more readable