anchor.diff:        let req = RetrieveEntityRequest ()
         req.EntityFilters <- EntityFilters.All;
         req.LogicalName <- name.ToLower();
  -      let resp = proxy.Execute(req) :?> RetrieveEntityResponse
  +      let resp = diffSolutionInfo.proxy.Execute(req) :?> RetrieveEntityResponse
   
         NotEntity (devEntity, prodEntity, resp)
      else
        UnhandledEntity
   
   // Help: https://bettercrm.blog/2017/04/26/solution-component-types-in-dynamics-365/
  -let rec elim (proxy: IOrganizationService) diffSolutionUniqueName (devCustomizations: string) (prodCustomizations: string) (devNode: XmlNode) (prodNode: XmlNode) output =
  +let rec elim (diffSolutionInfo: DiffSolutionInfo) (devNode: XmlNode) (prodNode: XmlNode) output =
     log.Verbose "Preprocessing";
     let expr = "//IntroducedVersion|//IsDataSourceSecret|//Format|//CanChangeDateTimeBehavior|//LookupStyle|//CascadeRollupView|//Length|//TriggerOnUpdateAttributeList[not(text())]"
     selectNodes devNode expr |> Seq.iter removeNode;
     selectNodes prodNode expr |> Seq.iter removeNode;
     
  -  let GenericAddToSolution = elim_elem (proxy, devCustomizations, prodCustomizations) output diffSolutionUniqueName
  +  let GenericAddToSolution = elim_elem diffSolutionInfo output
     let entities = selectNodes devNode "/ImportExportXml/Entities/Entity"
  +  
  +  let { proxy = proxy; solutionUniqueName = diffSolutionUniqueName; } = diffSolutionInfo
     
     entities
     |> Seq.iter (fun dev_ent -> 
  -    let isEntityNode = NodeIsNotEntity proxy diffSolutionUniqueName output dev_ent prodNode
  +    let isEntityNode = NodeIsNotEntity diffSolutionInfo output dev_ent prodNode
       match isEntityNode with 
         | NotEntity (dev_ent, prod_ent, resp) ->
         let AddEntityDataToSolution = GenericAddToSolution dev_ent prod_ent (Some resp)
  
positive.code:   | NotEntity of XmlNode * XmlNode * RetrieveEntityResponse
    | UnhandledEntity
  
  let NodeIsNotEntity (proxy: IOrganizationService) diffSolutionUniqueName output (devEntity: XmlNode) (prod_node: XmlNode) = 
    let entityNode = devEntity.SelectSingleNode("EntityInfo/entity")
    if entityNode <> null then
      let name = entityNode.Attributes.GetNamedItem("Name").Value
  
negative.code:   doc.Save(writer);
    sw.ToString()
  
  let diff (proxy: IOrganizationService) diffSolutionUniqueName (devExtractedPath: string) (prodExtractedPath: string) output =
    log.Verbose "Parsing DEV customizations";
    let devDocument = XmlDocument ()
    devDocument.Load (devExtractedPath + "/customizations.xml");
    log.Verbose "Parsing PROD customizations";
    let prodDocument = XmlDocument ()
    prodDocument.Load (prodExtractedPath + "/customizations.xml");
    log.Verbose "Calculating diff";
  
    let diffSolutionInfo = {
      proxy = proxy
      devExtractedPath = devExtractedPath
      prodExtractedPath = prodExtractedPath
      solutionUniqueName = diffSolutionUniqueName
    }
  
    elim diffSolutionInfo devDocument prodDocument output |> ignore;
    // log.Verbose "Saving";
    // File.WriteAllText (__SOURCE_DIRECTORY__ + @"\diff.xml", to_string dev_doc);
  
  