House Democrats close to Nancy Pelosi (D-Calif.) are circulating a letter within the Democratic Women’s Caucus pledging support for the California Democrat to remain House Democratic leader amid growing frustration at the party’s disastrous showing in Tuesday’s election.

The letter, written by Rep. Doris Matsui (D-Calif.), says that Pelosi helped Democrats achieve “historic progress in the lives of women, workers, students, veterans, seniors and LGBT Americans,” according to a copy of it obtained by the Washington Post. As of Friday afternoon 40  of the 54 women had signed the letter, according to aides.

“We believe that now, more than ever, our Caucus and our country need your strategic, battle-tested leadership to guide us through the years ahead,” the letter reads. “As we work to guard our accomplishments for hard-working families and preserve an inclusive and forward-looking America, we will be stronger with you as Democratic Leader. You have our support, and we ask you to continue as the Leader for our party and our nation.”

The letter comes as Pelosi’s allies are furiously working to defend her job as minority leader in the wake of smaller-than-expected gains for House Democrats in Tuesday’s elections that saw the victory of Donald Trump and a continuation of the Senate GOP majority. Pelosi’s allies have heard complaints about her leadership after six years in the minority and are moving aggressively to get ahead of them, according to several senior Democratic aides.

Democrats are scheduled to choose their party leaders on Thursday, according to aides. Some members had hoped their leadership elections would occur after Thanksgiving in order to give members more time to regroup after the elections.

Rank-and-file House Democrats are angry with leaders at every level of the party and want to see blanket changes to Democrats’ message, approach and leadership structure, according to many aides. A growing number of young and recently elected House Democrats want term limits for committee leaders and are pushing to elect at least one reform-minded member to their official leadership ranks.

The only open seat within Democrats’ ranks is Vice Chair of the caucus, the fifth position in the leadership slate. The race pits Congressional Hispanic Caucus chair Rep. Linda Sanchez (D-Calif.) against Rep. Barbara Lee (D-Calif.), the former chair of the Congressional Black Caucus. Sanchez, who has pledged to find ways to promote and empower new members, could get a boost from those members pushing for change.

Meanwhile, across the Capitol, Senate Democrats are engaged in their own battle over the remaining pieces of power left for them. After 20 years as the top Democrat on the Judiciary Committee, Sen. Patrick J. Leahy (D-Vt.) has signaled to the incoming minority leader, Sen. Charles E. Schumer (D-N.Y.), that he would like to become the ranking member of the Appropriations Committee, according to a senior Democratic aide familiar with Leahy’s thinking.

Elected in 1974, Leahy is the longest serving senator and therefore can choose from several committees. He has previously passed up leading the Appropriations Committee, but now wants to oversee the funding of the federal government.

That would open up the Judiciary Committee for Sen. Dianne Feinstein (D-Calif.), who has previously served atop the Intelligence Committee, where much of the work is done in secret without a high profile. Should she take the Judiciary slot, Feinstein’s first role would be taking on President-elect Trump’s Supreme Court nominee.

All this comes as Democrats await the next move by Sen. Patty Murray (D-Wash.), a highly respected member of leadership who has been silent about what role she wants to play in the newly crafted world of Schumer’s leadership team.

Currently No. 4 in leadership, some wonder whether Murray would challenge Sen. Richard J. Durbin (D-Ill.) for the minority whip post, which is the No. 2 slot. However, Murray has sent no signals that a challenge is forthcoming, and she could move up to take Schumer’s former slot as No. 3 in leadership and carve out her own role there.

Durbin said Wednesday that he was confident he had the support to remain whip.

“I’ve been reaching out to my caucus and there’s support for that,” Durbin said on Wednesday. “I’ll keep calling [members]. I look forward to being part of this leadership team.”

That would also leave Murray as the top Democrat on the Health, Education, Labor, Pension Committee, keeping Sen. Bernie Sanders (I-Vt.) as the ranking member of the Budget Committee.

Mike DeBonis and Ed O’Keefe contributed to this report.