One of the most jarring things about entering Brazilian favelas, or shanty towns, is how precarious everything looks.
The buildings are made from cinder block, the roads are potholed and uneven, and wires stealing cable TV, electricity and phone services wind their way along every street and into almost every house.
Another arresting facet is the commerce. In most cities, even shops far from the high street have plate glass windows showing their wares and colourful advertisements highlighting the latest deals. In favelas, the shops tend to be tiny. Many sell food and drink, clothes or building materials in cramped, open-fronted premises with little more than a counter and a few shelves.
But as Brazil's economy grows and millions join the middle class, that is changing. Those leading the way are not just retailers but high street banks. There is cash in chaos and bankers who turned up their noses at the poor are now aggressively courting their business.
Over the past year, three of Brazil's biggest banks have opened branches or ATMs in favelas and they are now changing the way they do business to attract this growing clientele.
There are two main reasons for the change: above-average rises in the minimum wage; and a wide-ranging assistance programme that gives a monthly stipend to mothers who keep their children in school and undergo health check-ups.
These measures have helped to free some 24 million Brazilians from absolute poverty and lift 31 million into the middle class.
The definition of middle class is pitifully low by western standards but banks and retailers understand that for the first time these people have money to spend.
Another reason is the arrival of law and order into the favelas of Rio de Janeiro. Authorities have expelled the drug traffickers who controlled a dozen of the worst favelas and introduced community policing into areas that used to be off limits to the state.
Millions of people live there and banks and retailers are keen to do business with them.
Banco Santander opened its first branch in the once violent Complexo de Alemao last May and plans to open more in neighbouring communities.
Itau also installed its first ATMs in favelas last year and the Banco do Brasil opened branches in Rio, Brasilia and Sao Paulo.
"All the principal banks are talking about the increase in number of branches because all the movement that we are seeing," says Hideraldo Dwight, the director of distribution channels at Banco do Brasil.
"We know that to be part of these people's live on a daily basis, and to generate wealth, you need to be there on the radar, on their streets."
To do this the banks have had to change the way they operate. Normally in Brazil, banks - and phone companies, cable TV providers and others - demand clients provide reams of paperwork just to prove they are who they say they are, and they live where they say they live.
There is a reason for the lack of trust - fraud and defaulting is common in Brazil - but the bureaucracy was excessive.
Now clients in favelas, where addresses are rarely official, no longer have to provide the proof of residence they did not have.
The minimum amount required to open an account has been lowered and banks are accepting a hand-written statement from new clients stating how much they earn.
Such moves open the way to huge growth. A government study released this year showed 39.5 per cent of Brazilians do not have a bank account. In the poorer north and north-east regions, that number rises to above 50 per cent.
Education is a major factor. Those with a university education are twice as likely to have an account as someone who did not finish secondary school.
About 40 per cent of those without bank accounts want one, the study said, and their inclusion in the formal sector will become more important as the poor are given credit cards.
Brazil's banks are among the most profitable in the world: Bradesco made US$6 billion (Dh22.03bn) last year; Itau closed the year up $5.8bn; and Banco do Brasil was $7.1bn to the better.
As they expand further, it looks as if they may get even richer.