message refactor