Legacy System Modernization: When to Rebuild, Refactor or Replace
The short answer
Refactor when the software still does what the business needs and the gaps can be fixed inside it. Rebuild when new functionality will not fit the foundation. Replace only with new custom software and a planned cutover.
Refactor a legacy system when it still does what your business needs, for the most part, and what is missing or slow can be fixed inside it. Rebuild when the big new functionality you need will not fit on the current foundation, and replace when the old system has to be retired, which should mean new custom software with a planned cutover, never a packaged product.
Before any of that, be careful who is recommending the rebuild. “If a vendor pitches a rebuild, I’d immediately be skeptical, and I would expect the client to be skeptical,” says Robert Kehoe, Founder & CEO of Active Logic. Rebuilding is easier and more profitable for a vendor, us included. On the client side, he says, “the reason you want to rebuild is not always technical in nature,” so the first questions are business ones: does the platform do what you need, and does it do it efficiently? That is where our application modernization services start. Active Logic is a 100% U.S.-based custom software company with 200+ projects delivered since 2014. The examples below are from our own work, with clients kept anonymous.
What is legacy system modernization?
Legacy system modernization is the work of deciding what to do with older software that still runs part of your business, then doing it without taking the operation down. “Legacy” does not mean broken. Most legacy systems we see still do their job every day and hold years of decisions about how the company works.
There are three paths:
- Refactor: keep the product and improve its internals. Martin Fowler’s definition of refactoring is the plain version: “a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior.” Bringing the framework underneath an app forward belongs here too.
- Rebuild: build a new foundation for the same system because the current one cannot take the business where it needs to go.
- Replace: retire the old system and move the work onto new custom software on a date everyone has planned for.
Why should you be skeptical of a vendor who pitches a rebuild?
A vendor has reasons to like rebuilds that have nothing to do with you. Rebuilding means nobody has to dig into another team’s code and learn why they built things the way they did. It gives the vendor more control. It usually takes longer, which means more billable time. Finishing or maintaining an existing system does not feel like as much profit.
“It’s hard for us to be objective,” Robert says. “If you want to rebuild it and you have reasons why, the vendor had better have some good reasons why.”
So we often lean the other way. “A lot of the time we will actually lean toward not rebuilding, because we don’t want it to seem to our clients like we’re trying to take advantage of the situation,” he says. Companies weighing a rebuild usually come to us because their last experience did not go as planned. Fixing a few things first and working with what they have is how we earn their trust.
When is a refactor the better call?
Refactor when the product is right and the problem is underneath it.
We have been doing this on an AI video monitoring platform we built for industrial sites. The product fits its users. The pain was in the core: integrations that connect the platform to the rest of the operation had been wired tightly into the middle of the system, so a change in one place could break something somewhere else.
Our developers have been moving those integrations out of the core into a plugin-style structure. The rule for each move: it has to behave exactly as it did before, and anything found along the way that the move did not cause gets its own ticket. A set of very old pages that slowed every deploy is being moved onto a newer interface layer, which was expected to cut compile time from about five minutes to something like 30 seconds. Those are reasons to pull old parts out of the way, not to throw out a system that already fits.
Sometimes the work is narrower. On an aging business app, we brought the framework forward four major versions, one at a time, with zero visible change for users. That catch-up was a couple of weeks of focused work; a yearly upgrade once you are current is generally not that big of a deal. Neither is a rebuild.
When should you rebuild?
Rebuild when the business now needs more than the current foundation can honestly support. “The product has to grow and evolve with the company,” Robert says. Even then, a rebuild rarely means ripping everything out at once.
A client came to us to build a mobile app. Because we asked the business questions first, we dug into all of the software they already had. The bigger issue was underneath: there was no API layer over the central database it needed to talk to, and that same database sat behind their reporting, their website and integrations with about 10 other pieces of software they use. They also wanted to redo parts of those systems over time.
That could not be one big fixed project. “There’s no way we could have done that,” Robert says. We moved to an agile engagement instead. “Let’s start with what you have that’s currently working, and then we can refactor some things as we go,” he says. “We’re not going to rip and replace everything immediately. We can do little parts at a time. That’s the sweet spot.”
The part that did warrant a rebuild was the foundation: an API-first single source of truth that the mobile app, reporting, website and other systems all talk to. “We really need to build the foundation properly,” Robert says. “And then all these other pieces can talk to it, almost like clients talking to one central source.”
Sometimes the whole system needs it. For years, we advised a nonprofit client not to rebuild, and that was the right advice. When their board wanted bigger capabilities, they asked to see both paths: upgrade the current platform, or rebuild it completely. The upgrade was a viable shorter-term option, but there was only so much room to grow on that foundation. A complete rebuild was the right call. It is still their software and still custom, and settings that used to be baked into the code, like thresholds, notifications and order rules, became choices their staff can make themselves.
When does replace make sense?
Replace when the old system needs to be retired, not improved. Replace means new custom software with a planned cutover. It does not mean buying a packaged product because your current system got old. Swapping out old screens or pulling integrations out of the core is part of a refactor, not a replace.
Before you replace anything, check whether the system just needs to talk to the rest of the business. An ERP that still does its core job is often better connected than ripped out, as we covered in MES ERP integration: connecting ERP and MES on the plant floor.
Who should own the code, the data and the product?
“I want the client to own their data. I want them to own their code, their own product,” Robert says.
That is a big part of why we favor custom software. “Any business with nuance should have custom software. Almost 100% of the time,” he says. “You can use Salesforce and customize that, but again, it’s still custom.” Heavily customizing a packaged platform is custom work without the same ownership of the code and the product.
A client recently came to us wanting to rebuild all their software because the company that built their custom software owns it. They are worried they cannot even get their data out without paying a large sum. Robert’s word for a vendor owning a client’s custom software is “absurd.”
A simple way to decide: business questions first
Start with business questions. Technical ones come second.
Business questions first
- Does the platform do what you need it to do, for the most part? Some things may be broken. At a high level, does it accomplish what you were hoping for?
- Does it do it efficiently? If not, can that be added to what you have?
- What big new functionality does the business need next? List it before anyone talks about code.
- Do you own the code, the data and the product? If not, that changes the conversation.
Then technical questions
- Will the new functionality fit well? Is the current system set up to support it?
- How old is the code?
- What does an audit show? We use a code auditing tool we built in-house, with a large number of checkpoints, to get an honest read on a codebase before recommending anything.
If the answers to the first two are yes, or “yes, with fixes,” start with a refactor. If the big new functionality will not fit, a rebuild belongs on the table, usually in small parts and starting with the foundation, and the vendor recommending it should be able to explain exactly why. If the old system needs to go entirely, replace it with new custom software and plan the cutover before anyone writes code.
| Path | Keep the product? | Keep the foundation? | Typical trigger |
|---|---|---|---|
| Refactor | Yes | Mostly, improved in place | Does the job; needs fixes, speed or an upgrade |
| Rebuild | Its purpose, yes | No | Big new functionality will not fit |
| Replace | No, retired on a set date | No | Old system needs to go; new custom software takes over |
How does a planned cutover work?
Whatever path you pick, the switch is where the business feels it.
On the nonprofit rebuild, the pattern was consistent:
- Production goes live when it is ready, not when a calendar says so.
- A beta copy lives in staging, sometimes reset every night, so staff can train against real data without putting live operations at risk.
- When the numbers do not match, agree on a date. When inventory counts in the old and new systems did not line up, the plan was to pick a reconciliation date, count once, and treat the new system as the source of truth from that day forward.
On the industrial platform, the same idea shows up as a quality gate: internal review, a green light from the client, and only then a wider release.
Rebuilding in small parts also keeps each cutover small. One piece moves onto the new foundation at a time while the parts that work keep running, instead of the whole business switching systems on one day.
What risks do owners underestimate?
Waiting too long. We have seen an app run three versions behind and end with a security incident.
How to start
- Write down what the system does for the business: the decisions and rules it carries, not its features.
- Answer the business questions above before you talk about technology.
- Put the cutover in scope from day one: staging, training, a reconciliation plan and a rollback.
If you are weighing what to do with a system your business depends on, we are happy to talk it through. We will tell you if the answer is to keep what you have.
Frequently asked questions
What is legacy system modernization?
Legacy system modernization is deciding whether to refactor, rebuild or replace older software that still runs part of your business, then doing that work without disrupting operations.
Should I refactor, rebuild or replace a legacy system?
Start with business questions: does it do what you need for the most part, and does it do it efficiently? If yes, or yes with fixes, refactor. Rebuild when big new functionality will not fit the current foundation, usually in small parts. Replace when the old system should be retired, with new custom software and a planned cutover.
Should I trust a vendor who recommends a rebuild?
Be skeptical, including of us. Rebuilding is easier and more profitable for a vendor, so ask for specific reasons and check them against the business questions first: does the current system do what you need, and can what is missing be added?
Does replacing a legacy system mean buying off-the-shelf software?
No. Replacing a legacy system should mean new custom software with a planned cutover date, and you should own the code, the data and the product. A heavily customized packaged platform is still custom work, without that ownership.
What does a safe cutover look like?
A staging copy where staff train on real data, a go-live when production is ready, an agreed date and source of truth if old and new numbers differ, sign-off before wider release, and a way to roll back.

