Refining the thrift protocol