Bank of America Corp is working to improve profits by reducing its number of problem mortgages and cutting other expenses, Chief Executive Brian Moynihan told shareholders on Wednesday.

Moynihan, speaking at the company's annual meeting in downtown Charlotte, said the mortgage business of the largest U.S. bank by assets is still struggling mightily as it slowly crawls out from under billions in soured home loans.

There's still a lot of work ahead to get through this, Moynihan told shareholders.

At the meeting, shareholders elected all 13 director nominees onto the board of directors. No shareholder proposal gained enough support to pass, including one by the New York City Comptroller seeking a review of BofA's foreclosure practices.

The bank's annual meeting -- during which shareholders asked some contentious questions, particularly about the company's mortgage operations -- was a far cry from the slugfests between shareholders and management in recent years.

The meeting was held in a smaller auditorium that seats roughly 450 in a downtown Charlotte office tower adjacent to the company's headquarters.

Unlike the previous two annual meetings since the 2008 financial crisis, empty seats were scattered throughout the auditorium, and investors began to trickle out before the meeting's conclusion.

Two years ago, shareholders blasted management for the purchase of Merrill Lynch, and for the performance of then-CEO Kenneth Lewis. Since then, the company has brought in nearly an entirely new board and changed much of its management team.

During the nearly three hour meeting this year, shareholders were as complimentary of Moynihan and BofA's senior management as they were critical.

You were put in the position to do an impossible job, said Jim Connelly, a Washington, D.C.-based shareholder in the bank, who then complimented Barbara Desoer, Bank of America's mortgage chief, on her work with the bank's mortgage problems.

Moynihan, in his prepared remarks to shareholders, described the bank as a tale of two companies.

Most of the bank is beginning to return to normal as the bank is working to build more consistent, predictable returns.

But BofA's mortgage woes that are crimping earnings will not vanish overnight, he said.

Its obvious we have to get the mortgage crisis behind us, he said.

The two primary risks to the mortgage business are regulatory demands and the potential cost of principal writedowns, he said.

Moynihan, who replaced Lewis as CEO in January 2010, initially produced a string of profits for the bank. But bad mortgages have held Bank of America back from the levels of profitability that some rivals have been reporting in recent quarters.

Bank of America's losses in the second half of 2010 came as a surprise to some investors. While significant non-cash charges weighed on the bank's bottom line, its mortgage business also hampered core results.

Although Bank of America reported a first-quarter profit of $2 billion, earnings missed analyst expectations and were below the bank's year-earlier profit of $3.2 billion.

As BofA works to combat legacy loan problems, finding new business has been challenging as well. Its revenue and loan portfolio have continued to shrink in recent quarters as the U.S. economic recovery has slowed.

Investors are spooked the bank could be on the hook for billions more in soured mortgages held by outside investors, and that its foreclosure problems show no signs of abating.

Bank of America's home loans business lost $2.39 billion during the first quarter alone.

BofA was also one of a few banks whose dividend increase proposal was rejected by the Federal Reserve this year, following a second round of stress testing. The company has been paying only 1 cent per share quarterly.

At the meeting on Wednesday, Moynihan reiterated his assertion that BofA will pay a higher dividend as soon as it receives regulatory approval and that share repurchases are a high priority.

General Counsel Edward O'Keefe also said that the bank paid $1.4 billion worth of legal fees last year.

Moynihan said Bank of America must judge how a mortgage repurchase dispute will damage you on the other side when considering a settlement. Moynihan's comment was softer than the tone of his remarks last year, when he said the bank would engage in hand-to-hand combat in repurchase battles.

BofA shares were unchanged at $12.28 in Wednesday afternoon trading.

(Reporting by Joe Rauch; Writing by Lauren Tara LaCapra; Editing by Gerald E. McCormick, Matthew Lewis and Tim Dobbyn)