Refactoring

Merge message branch into refactoring