Sometimes the best opportunities are right under our noses. And while there has been plenty of negativity surrounding Bank of America (NYSE:BAC), its individual units are actaully performing well. Some are performing spectacularly.

No one would know it, though, if they just looked at Bank of America as a whole. Beneath the consolidated financial statements are an excellent U.S. retail bank, one of the world's best asset management businesses, and a rising investment bank.

The headlines, however, only focus on the old Bank of America – the legacy stuff that makes many investors cower in fear of ever owning a bank stock ever again.

At just about $160 billion for the whole company, I think there's a case to be made Bank of America is worth much more. In fact, looking at the individual pieces, Bank of America is worth as much as 25% more than it trades today.

Let's look at those individual pieces right now.

Consumer & Business Banking: The Biggest Chunk

You wouldn't know it from the headlines, but Bank of America's traditional retail bank is on fire.

Let's run through the good and the bad of B of A's Consumer & Business Banking unit, detailing the most important earnings drivers for what could soon be one of America's best banks.

The good: deposits and loan losses
The Consumer & Business Banking unit is a very traditional bank built on the back of low-cost deposits and interest-earning loans and investments. This isn't the ugly stuff that people tend to shy away from when they talk about financial stocks. It's not an investment bank. It's not stuffed full of derivatives or "alphabet soup" investments. Rather, it's one of the best deposit gatherers in the country.

In the first quarter of 2014, Bank of America reported an astonishing $518 billion in deposits in its traditional banking unit. These deposits cost the bank just 0.07% in the first quarter, putting it among the best banks in the country at sourcing low-cost deposits.

If it weren't enough that Bank of America pays peanuts for deposits, service charge revenue has been coming in to the tune of more than $4 billion per year. Service revenue has declined slightly, but a 2% decline in light of an improving economy is nothing to worry about. It turns out late fees and overdrafts tend to peak in recessions, not recoveries.

And its lending and investments are doing fine, too. Although its net interest yield has been in decline as higher-yielding assets roll of the balance sheet, declining spreads have been offset almost entirely by a growing pile of earning assets. Net interest income is virtually unchanged from 2012 to 2014.

The bad: costs
There are really two models in traditional banking. Either a bank will have very high cost deposits, and thus low operating costs, or it will have very inexpensive deposits, and higher operating costs. C&BB fits in the latter category. Its customers are largely willing to forgo higher interest rates on their deposits in exchange for a vast branch network, online banking tools, and more customer service.

These costs are dragging down the bottom line. And although Bank of America has been slashing its branch count to contain and reduce costs, the reality is that it still spends heavily maintaining its network of branches.

In 2012, the bank had 5,651 branches. As of the first quarter of 2014, branches have been slashed to 5,095. These branches have been shuttered, and, in some cases, sold to other banks. Reducing branches has been very favorable for shareholders, who have watched the company's non-interest expense decline year after year.

Looking ahead
You can model the future for Bank of America's C&BB banking unit however you'd like. But at the end of the day, the biggest earnings driver is undoubtedly the company's plan to cut its costs by eliminating branches, and adopting smaller branches with fewer employees and more automation.

From first quarter 2013 to first quarter 2014, the bank cut 294 branches. Noninterest expense fell by $180 million per quarter during that time.

This is significant; it's equal to roughly 7% of Bank of America's first-quarter pre-tax income. And I think it's only just the start of additional cost-cutting measures necessary to drive down the bank's on-going operating costs.

Cost cuts are the biggest reason why I believe Bank of America can continue to generate excellent returns on capital it allocates to its Consumer & Business Banking unit. In the last two years, and including the annualized performance in the first quarter, the segment has generated returns on average allocated capital of greater than 22% per year.

So what's it worth?
A multiple on allocated capital makes most sense to me. Few banks earn 22% returns on equity year after year, and thus, a multiple of 2.5 times allocated capital makes sense. That's roughly in line with price-to-book value multiples other banks are getting. At that valuation, C&BB would be worth roughly $74 billion.

Insane? Not really. That same multiple values it at less than 12 times annualized, first-quarter earnings.

It may be too conservative, in fact, given how leveraged it is to a steepening yield curve. A modest half-percentage point increase in spreads would add roughly 30% to the bank's bottom line. But we'll stick with a valuation of roughly $74 billion, which, I believe, builds in a reasonable margin of safety while ignoring the potential of a steepening yield curve and reduced operating costs.

Total running value: $74 billion

Global Banking: The Wall Street Powerhouse

Name the number one investment bank.

No, it's not Goldman Sachs (NYSE:GS) or JPMorgan (NYSE:JPM). It's Bank of America.

The bank that everyone loves to hate is on the mend, and part of its investment banking arm, through its Global Banking unit, is performing spectacularly.

What Global Banking does best
Global Banking is best described as a commercial and corporate banking unit. It's here that Bank of America stashes most of its investment banking advisory fees, a portion of its debt and equity underwriting fees, and fees and interest income from a more traditional corporate and commercial bank. 

When I think about Global Banking, I think about two discrete units. The first is the commercial banking portion, which works with smaller, middle-market businesses. Then there's the investment and corporate bank, which works with the world's largest companies, governments, and institutions.

A hedged business
Bank of America's Global Banking unit has performed well as low rates encourage corporate borrowing, boosting investment banking fees and loan growth. On the other hand, lower rates aren't good for the loan book, which has seen its net interest spread shrink by 0.5 percentage points, from 3.18% to 2.68% in the first quarter of 2014. A recent company presentation calls for $8.8 trillion in global debt issuance in 2014, down from a peak of $9.5 trillion in 2013.

Moreover, the bank is crimped by new regulatory oversight. In the middle market, for instance, regulators have imposed a soft limit of 6 times EBITDA leverage for buyout deals. That could soften demand for cheap leverage from Bank of America's corporate bank.

The good news, though, is that higher rates will lead to rising net interest income. Loans and leases are priced on LIBOR, thus an increase in interest rates may stymie the growth in debt underwriting fees, but propel earnings from the loan book.

Credit trends are improving. In the first quarter, nonperforming loans and foreclosures fell to 0.24% of assets, down from 0.66% in the first quarter of 2013.

Valuing Global Banking
Is the economy in the top of the third inning, or the bottom of the ninth? That's the real question for any cyclical business. And while I could pretend to know what the economy will bring three or four years down the line, I certainly don't know.

But that doesn't make the bank impossible to value. Rather, it means we have to be conservative and build in a margin of safety.

For a bank that generated greater than 20% returns on allocated capital in 2013, a multiple of 1.5 times allocated capital makes sense to me, given that cyclical, and largely unpredictable, investment banking revenue makes up roughly 20% of net revenue. That would give Global Banking a valuation of $46.5 billion, less than ten times net income in 2013, and well in-line with its peers.

Upside comes in the form of an improved expense line. Bank of America has proudly ditched its least-valuable clients, slashing its client list by 55% since 2010. And although that may seem like a grave mistake, average revenue per client has doubled in that time. Becoming leaner has resulted in better profitability, for which shareholders should be very pleased.

Total running value: $120.5 billion

Global Markets: A Cyclical Winner

What's a room full of traders worth?

To Bank of America, the answer is about $1.6 billion in net income just last year.

Looking at the trading desks
B of A calls this group "Global Markets," and it thrives on trading revenue. Last year, trading account profits made up the largest slice of the segment's revenue net of interest expenses. This has been the case for several years running, even in a post-Dodd-Frank environment.

The Global Markets business also follows the investment banking business in Global Banking. Bank of America allocates the bulk of advisory revenue to Global Banking. However, fees and commissions earned in brokering new deals mostly flow to Global Markets.

Global Markets isn't your average banking asset. The biggest driver of earnings is trading account profits. Total loans and leases make up just over 10% of the unit's total assets, and roughly 20% of net revenue.

The death of FICC
In the last year, we've heard time and time again that trading is dead. Revenue earned from FICC -- Fixed Income, Currencies, and Commodities -- is on a downward trajectory. Analysts have slashed their expectations for many of the bigger banks.

As always, though, these projections extrapolate today's industry realities into the future. And while the markets are benefiting from lower volatility, which hurts trading profits, this won't always be the case.

After adjusting for one-time events, Bank of America's Global Markets did see a year-over-year decline. Rival JPMorgan forecasts a 20% decline in FICC revenue for the second quarter. Goldman Sachs'13% decline in FICC revenue adds another data point that maybe traders are hitting a wall.

A bad business?
Trading can be a great business, but profitability largely hinges on volatility. You can't make much trading if asset prices merely stagnate.

Forecasting profitability for a trading outfit is about as much as a crapshoot as anything. But in the last three years, profits have topped $1 billion annually at Bank of America's Global Markets.

So what's it worth? A good comparable is Goldman Sachs, which trades at about 10.5 times trailing earnings. Though Bank of America's Global Markets probably isn't a Goldman Sachs, its Global Markets unit is deserving of a similar, but lower, multiple of earnings. A multiple of 9 times earnings seems fitting.

Excluding a one-time tax charge of $1.1 billion in 2013, Global Markets would have generated profits in the neighborhood of $3 billion. Thus, a multiple of 9 times earnings gives Global Markets a value of about $27 billion.

The fact of the matter is that volatility is gone today, but tomorrow is a different day. There's little reason to discount what is otherwise a great business for one or two quarters of lower profitability. And while results will vary from quarter-to-quarter, over a cycle, Global Markets is probably too cheap at just 9 times earnings.

Total running value: $147.5 billion

GWIM: The Hidden Gem

Of the many moving parts at Bank of America, there's a standout student: Global Wealth and Investment Management (GWIM).

GWIM encompasses the very best of the Bank of America brand -- it's obscenely profitable, capital light, and on a path to create tremendous value for shareholders.

What makes GWIM great
Let's start at the top, and work our way through. Last year, GWIM earned about 30% on its allocated capital. Said another way, for every dollar Bank of America allocated to GWIM, it earned Bank of America $0.30 in a single year.

I'll wait while that digests. A 30% return on capital is exceptional -- I'd kill for returns like that.

This is what investors should expect from asset managers, which rely on other people's money, not their own, to drive profitability.

A star in its industry
Bank of America's GWIM unit has consistently been at the top in its industry for pre-tax margins (25.6% in the first quarter of 2014), client assets under management, and employee productivity. In the first quarter, its advisors were generating an average of $1.06 million in annual productivity to the company.

This revenue is largely driven by assets under management, the company's brokerage business, and net interest income.

You see, GWIM isn't a pure-play asset manager. It's more like an asset manager with a private bank hanging on for the ride. The first quarter of 2014 revealed assets were split into the following categories:

Assets under management: $842 billion
The very best of the business is right here. These assets generate royalty-like fee income in the form of management fees paid to the company every single day, year after year. 

Brokerage assets: $1.09 trillion
Brokerage assets are derived through the company's Merrill Lynch brokerage service. These assets generate transaction fees, but more importantly, they're easy pickings for GWIM's many private bankers and wealth advisors to turn these balances into fee-generating assets under management.

Deposits: $244 billion & Loans and leases: $120 billion
I'm combining these two, because they're an important part of the company's banking operation. Do note the very big difference in size between the loan book ($120 billion) and the deposits ($244 billion). The bank has plenty of room for loan growth to drive net interest margin by deploying more of its deposit base into loans to its high-net worth customers. As of February, only 12% of Merrill Lynch customers had a mortgage with the bank.

Assets in custody: $136 billion
These are sticky assets, but not a particularly important driver of revenue for the company. Rather, they serve as glue that holds U.S. Trust's wealthiest clientele to the company.

The bull case
GWIM is a natural beneficiary of an aging American population.

GWIM's funnel starts at Bank of America's core banking branches. There, Merrill Lynch will have as many as 2,000 advisors at the bank's roughly 5,000 branches. This acts as a very important marketing channel to bring in new business, and introduce Bank of America's millions of customers to highly profitable advisory products.

Andy Seig, head of Global Wealth and Retirement Solutions, explained that the bank had 5 million customers in other plans, from 401(k) programs to health care savings accounts. Servicing these plans creates a potential conversion every time they leave their employer, or seek out full-service retirement advice.

Additionally, with deposits exceeding loans and leases by $124 billion, the company has the capacity to generate substantial net interest margin going forward. Importantly, the company's loans to its clients are usually based on LIBOR, which means rate increases provide an instantaneous increase in net interest margin.

The final word
Bank of America's GWIM unit is firing on all cylinders, but there's still room for improvement. Rising asset valuations should help grow assets under management over time, while the bank's branches serve as a valuable lead-generating machine for its advisors.

Some 48% of Merrill Lynch customers use Bank of America's classic banking services. Nine million of its consumer banking customers have a household net worth exceeding $250,000. That's a prime well to tap for future revenue.

As a stand-alone business, I can't see why the company wouldn't be valued at multiples up there with some of the best asset managers in the business. T. Rowe Price trades at roughly 20 times last year's earnings, and 16 times forward earnings. I think that's reasonable for Bank of America's GWIM, which is, in my view, a substantially better business because it can ride the coattails of the bank's core unit.

At 16 times 2013 profits of roughly $3 billion, GWIM would earn a $48 billion valuation or about 30% of the whole bank's current valuation. While that valuation, and its accuracy, will largely hinge on the ups and downs of the market, it's quite clear to me that GWIM is a hidden gem in a bank investors love to hate.

Total running value: $195.5 billion

CRES: The Heaping Pile of Trash

It's no secret Bank of America has a financial landfill in Countrywide, the troubled mortgage lender it acquired in 2008. Now stashed quietly in a unit labeled Consumer Real Estate Services, this unit has been an absolute disaster for Bank of America.

Legacy assets cost a fortune
Bank of America has already paid more than $50 billion in litigation expenses stemming from its involvement in the housing bubble and subprime fallout. These costs almost exclusively flow through the company's Legacy Assets & Servicing unit, which includes Countrywide assets.

This chart sums up the cold, painful realities of Bank of America's Consumer Real Estate Services better than any:

Yes, CRES is one big money pit, but will it continue?

Putting a price on CRES
I'm hesitant to ascribe any value at all to CRES at all. In 2013, the company's non-legacy portfolio (what should be the "good stuff") generated a net loss of $118 million. The first quarter of 2014 wasn't any better, as losses tallied to $139 million on the non-legacy "home loans" portion of CRES. 

The elephant in the room, the legacy assets, generated a net loss of $4.8 billion after an income tax benefit of $1.8 billion. This was largely due to a $5.8 billion in expenses resulting from a settlement with the FHFA and additional funding of loss reserves for its legacy portfolio.

CEO Brian Moynihan has suggested that there is at least one more big settlement in the works. Big, at least for Bank of America, is likely in the range of $10 billion.

Furthermore, the non-legacy portfolio's profitability is leveraged to mortgage volume. Mortgage banking income fell to $178 million in the first quarter of 2014 from $697 million in the first quarter of 2013. Given that rising rates have effectively ended the easy money from a refinancing boom, I'm not convinced CRES's non-legacy unit can be profitable in the near future.

Thus, I'm valuing CRES at zero. While there is some value in the assets underlying the capital allocated to the business, from the standpoint of profitability, I see little to no reason to expect this to be a profit-generating unit for Bank of America in the immediate future. I'd prefer to mark it to zero, and allow the company's equity contribution to cover losses.

All Other
Bank of America's "All Other" unit is a bit of a slush fund that contains everything from non-U.S. cards, to deposits, and mortgages. I call it a slush fund because Bank of America uses All Other to fill in the gaps of its other units -- Consumer & Business Banking, Global Markets, and Global Banking -- to meet regulatory guidelines. Bank of America's main banking units trudge on a small capital base afforded by the backstop of assets included in this unit.

I should point out that BofA's "All Other" isn't in the same league as its legacy mortgage portfolios. All other is a collection of performing, although modestly profitable, assets. However, much of the benefit of "All Other" can already be found in the robust profitability of its banking units. In the best case, I'd give All Other credit for the equity investments ($2.1 billion) that it has on the books. But, to avoid double counting, and to favor conservatism in valuation, I'll mark this unit at $0.

Total running value: $195.5 billion

The Final Tally

Conservatively valued, Bank of America's fair value is likely found at least 25% higher than where it trades today.

There are tremendous opportunities for the company to build on what it does well. Its world-class asset management business has bountiful deposits that exceed its loans by more than $100 billion. Global Banking's asset yields will rise with interest rates. The Consumer & Business Banking segment has some of the lowest-cost deposits of any bank in the country with a clear path to cut its operating costs.

That's not to say Bank of America will follow a straight path higher. But for the patient investor, Bank of America's individual assets present a very attractive value. You just have to be willing to wait it out.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.