“CHANGE everything except your wife and children.” Thus spoke Lee Kun-hee, the boss of Samsung, two decades ago at an emergency meeting with his senior managers. He wanted the conglomerate (whose name means “Three Stars”, implying that it would be huge and eternal) to stop churning out vast quantities of cheap products and focus on quality, to become one of the world’s leading firms.

Mr Lee (pictured, left) accomplished his mission, probably beyond his wildest dreams. Today the Samsung group, whose 74 companies have estimated annual revenues of more than 400 trillion won ($387 billion) and 369,000 employees, is into everything from washing-machines and holiday resorts to container ships and life insurance. But it is the group’s predominant electronics division that has made its patriarch particularly proud: Samsung has overtaken its Japanese rivals to become the world leader in this industry by revenues, outselling everyone in memory chips, flat-panel televisions and smartphones.

Now Samsung is again at a point in its 76-year history at which much has to change. This will be underlined if, as expected, Samsung Electronics issues a fresh profit warning shortly. The company is not facing existential threats. But the world around it is in flux, and Samsung has to adapt—from top to bottom.

Start at the top. In May Mr Lee, 72 years old, suffered a heart attack. He is still in hospital. Nobody expects him to return as he did in 2010, when he came back after avoiding prison for embezzlement and tax evasion. (He got off with a suspended sentence of three years and was later pardoned so he could remain a member of the International Olympic Committee.)

Mr Lee’s only son, Lee Jae-yong (pictured, right), looks certain to take control of Samsung’s main businesses, and his two daughters will run some smaller ones. The younger Mr Lee, now 46, joined Samsung Electronics in 2001 and ten years later had the title of vice-chairman. Other than a few bare biographical facts, little is known about him. “He is unproven as a manager,” says Chang Sea-jin, a business-school professor and author of “Sony vs Samsung”, a book about the two Asian tech giants. Despite Samsung’s best PR efforts, most Koreans still associate him with eSamsung, a disastrous internet venture.

Those who have met him call him approachable and unassuming—quite unlike his father, who is known for an imperial management style. When the elder Mr Lee visited factories, the red carpet was rolled out and employees were not allowed to look down on him from the windows. In 1995 he had thousands of faulty mobile phones and other devices burned and bulldozed in front of weeping employees.

His son’s more restrained personality may be just what Samsung Electronics, in particular, now needs. To thrive it must attract flighty technical talent and get along with partners. Sent to Silicon Valley to negotiate with Apple, a big customer for Samsung’s chips (and a rival in smartphones), young Mr Lee apparently managed to get along with the often prickly Steve Jobs. He was the only Samsung executive to be invited to Jobs’s memorial service.

The succession is unlikely to happen before another badly needed change is well under way: reforming the group’s Byzantine corporate structure. For example, the group’s holding company, which has just changed its name from Samsung Everland to Cheil Industries, owns 19.3% of Samsung Life, which owns 34.4% of Samsung Card, which owns 5% of Cheil. (See the illustration below for a simplified depiction.)

This corporate hairball has let the Lees exert control over the group with a stake of less than 2%. But for various reasons they are now likely to simplify it, explains Shaun Cochran, a longtime Samsung-watcher at CLSA, a broker. One is that the rules against such circular shareholding structures are being tightened. But the most immediate consideration is the imminent succession—and the resulting inheritance tax. The family will have to pay about six trillion won, according to some estimates, and needs to raise cash.

This also goes a long way towards explaining why Samsung denies any talk of a restructuring: the more it seems a sure thing, the higher the share price and thus the tax bill. Because of the complex ownership structures, some listed companies within the group trade at a discount. When news broke of the older Mr Lee’s heart attack, the shares of Samsung Electronics went up—mainly because a restructuring was seen as more likely.

Denials notwithstanding, the restructuring has clearly begun. Earlier this month Samsung Heavy Industries and Samsung Engineering announced plans to merge. This will be followed by the IPOs of Samsung SDS, a provider of IT services, perhaps as early as November, and of Cheil, which is expected early next year.

The flotation of Cheil is key, argues Mr Cochran. Unlike other group companies it is controlled directly by the Lee children and a family foundation. The listings will not only raise cash, but also make it easier to put values on the group’s cross-shareholdings. So it will be easier to unpick these without attracting lawsuits.

The sooner all this happens, the better: the restructuring is distracting executives from running their businesses. One, in particular, needs attention: smartphones. Not only has it been directly responsible for a big chunk of the profits at Samsung Electronics, and thus the group; it is also the biggest customer for other parts of the business, such as making chips and displays.

Samsung Electronics came from nowhere in the space of a few years, to grab one-third of the market for smartphones in 2012. It did so mainly by being among the first to bet on Android, Google’s popular mobile operating system, and by offering iPhone-like handsets at lower prices than Apple. Yet since then, problems have been piling up, and Samsung’s market share has now slipped to 25%, reckons IDC, a market-research firm. The Galaxy 5S, which Samsung introduced in January, was derided for its cheap plastic casing.

Low-cost makers from China, such as Xiaomi and Huawei, and new European brands such as Wiko and Archos, are attacking Samsung’s market from below. From above, Apple has regained share, and looks set to keep doing so after its recent launch of a “phablet”, a phone with a large screen—a category where Samsung still had an advantage. What is more, the smartphone market is maturing; indeed, in Britain it is already shrinking.

If fighting back were simply a question of making better hardware, Samsung would be safe. This is what it knows best, says Ben Wood of CCS Insight, another market researcher. Since it launched Galaxy Gear, a smart watch, a year ago, it has followed up with five further models. “Samsung is prototyping in public,” says Mr Wood. But smart watches also show why Samsung is in trouble. The Apple Watch, launched at the same time as the bigger iPhone, may look a lot like the Galaxy Gear, but it comes embedded in an ecosystem of software and services, such as a new touchless payment system and sophisticated health-monitoring apps.

Samsung will have a hard time matching such an ecosystem. It does not control Android, and an effort to establish its own mobile operating system, Tizen, seems to have been put on the back burner. Being structurally a hardware company, and one with a conformist Confucian culture, Samsung would surprise many if it suddenly came up with great apps and services.

So, the firm’s best chance is to stick with gadgets, and to try to create ones that consumers love so much that they fly off the shelves, argues Francisco Jeronimo of IDC. But it has to act fast. The fates of Nokia and BlackBerry (which made another attempt at a comeback on September 24th by launching a new smartphone, the Passport) show how quickly fortunes can reverse. And Apple sold 10m of its new iPhones, including an updated smaller model, in three days—a number that the Galaxy 5S only reached after 25 days.

In all, the younger Mr Lee has his work cut out for him. Samsung-watchers wonder if he has it in him, but when he takes over he may have to make a “change everything” speech of his own.