Refactoring Message class.