Refactor message hierarchy.