refactor message classes