Factoring out XMsg app stuff.