created message class and case handling for different message types