define of message class functions moved to header file