add some infrastructure code for proto handlers