replace json infrastructure with protobufs