Adjust message parsing to allow different message types