Extract out parsing proto file logic from ProtobufGen

good catch