Even if surveillance reform legislation passes in Congress, the courts might still allow the U.S. government to collect communications data in bulk, a top Justice Department official told the Senate Judiciary Committee on Wednesday.

“If the USA Freedom Act becomes law, it’s going to depend on how the court interprets any number of the provisions that are in it, and any number of the additional requirements that are contained in it over what is here now,” Deputy Attorney General James Cole said in response to a question from Iowa Republican Sen. Chuck Grassley. “On the bulk data, I think it’s going to be a question of the court’s interpretation.”

Senate Judiciary Committee Chairman Patrick Leahy, Democrat of Vermont, and Wisconsin Republican Rep. Jim Sensenbrenner recently co-authored surveillance reform legislation intended to bar the U.S. government from using Section 215 of the Patriot Act to collect communications data in bulk. The proposal is a response to revelations from former NSA contractor Edward Snowden, who in June leaked a secret Foreign Intelligence Surveillance Court order renewing a request for the communications data of millions of Verizon customers.

Cole’s testimony suggested that even if the Sensenbrenner-Leahy legislation passes, the courts could still interpret the law to allow for bulk data collection.

National security officials have warned against ending the surveillance program, and California Democratic Sen. Dianne Feinstein has proposed legislation that would explicitly authorize it. NSA Director Keith Alexander told senators at the sparsely attended hearing Wednesday that the threat of terrorism was getting worse, citing the civil war in Syria and ongoing unrest in Iraq. “From my perspective, the threats are growing,” Alexander said.

Using a library classification system as a metaphor, Alexander said, “Metadata is a way of knowing where those books are in the library, and a way of focusing our collection, the way our allies do, to look at where are the bad books.”

Leahy wasn’t buying the analogy. “I had my first library card when I was four years old. I understand libraries,” Leahy said. “Let’s talk about the NSA.”

During the hearing, Leahy told the panel of national security officials that while he recognized the threat of terrorism, he was concerned about Americans’ privacy. Leahy recalled a meeting with infamous former FBI director J. Edgar Hoover, in which Hoover told a group of prosecutors that the New York Times editorial page was lurching dangerously close to communism that and he intended to investigate it.

“We were all chilled by what we heard from him, his disregard for the Constitution,” Leahy said. “I’m almost thinking what it would have been like if he had the power that you and the NSA have.”

Robert Litt, the counsel to the office of the director of national intelligence, reassured Leahy that everyone in the intelligence community is “singularly focused on ensuring that we comply with the Constitution and the law.”