factored out MessageId class