refine proto and related logic