messages system refactored