Gets rid of TMessage, and use dynamic_cast instead