refactor message view helpers.