Refactoring and reingineering messages

Something works. Then I should parse it all.