building message class