A side note here:
Jefferson feverently believed in religious freedom and had co-authored the Virginia Statute on Religious Freedom.. He was not anti-Islam. He was anti-Islamist. That, I believe, is an important distinction. He had his own copy of the Koran and studied it, wanting to understand its tenets, and came to appreciate much of it.
While he admired the beauty of parts of the Koran, Jefferson also understood that fundamentalist Islamism was like no religion the world had ever encountered. Any religion based upon supremacism was not only repugnant to him but a warning.
Long ahead of his time, Jerfferson feared that someday this brand of Islamism would pose an even greater threat to the United States than that posed by the pirates.