[protocolbuffers\message] refactor type check block