Message protocol refactor