refactor binglog & protocal