Extract out parsing proto file logic from ProtobufGen

made the change