refactor message