Refactored Message-related stuff