split proto.h into types.h and proto.h