Protobuf refinements and unit tests