Refactor msgs