Refactoring: Moved some code into Message class