Rewrites are a trap,
refactor anyway
Most codebases don't need a rewrite — they need a measured refactor, a performance pass and a test harness. We reshape the system while the business keeps running, and we bring numbers out the other side.
CAPABILITIES
Six surfaces where refactoring lands
Code review, targeted refactor, performance repair, DB optimisation, debt triage and framework upgrades — run under one audit discipline.
Legacy codebase review
Architectural scan, hotspot detection, test-coverage map, risk ranking. Reviewable output the stakeholders can act on, not a 200-page audit nobody reads.
Targeted refactoring
Strangler-fig migrations, module extraction, test harness retrofit. We never rewrite from scratch — we change the shape while the business keeps running.
Performance repair
Profile, measure, fix. P95 latency halved, tail P99.9 stabilised, infrastructure cost dropped to match.
Database optimisation
Query plans, index design, read / write split, partitioning, caching. Migrations online, no downtime windows.
Technical debt triage
Prioritise by blast radius and revenue impact. Pay down what blocks the next quarter; park what does not.
Upgrade & modernisation
Framework upgrades (React 18→19, Node LTS, Rails, Django, Spring), dependency rollups, security patching cadence.
BEFORE · AFTER
Six measured deltas from real engagements
Not lab numbers. Real before-and-after measurements from codebases we've refactored, with the mechanism that moved the needle named in the right-most column.
N+1 queries eliminated · edge cache tier · async boundary
Remote cache · workspace split · incremental transpile
Contract tests · fixture generators · regression harness
Right-size · spot · autoscale · read-replica tier
Pipeline parallelism · trunk-based · review gates
SLO-driven refactor · circuit breakers · rollback drill
The "let's start over" impulse almost always costs more than the refactor. Strangler-fig migrations keep the business running while the codebase changes shape.
STACK
Profile · refactor · test · observe
The four lanes we run every refactor engagement on. Stack choice is driven by the existing codebase, never by fashion.
Profile
- pprof · perf · dtrace
- Chrome DevTools · Lighthouse
- Datadog APM · Sentry perf
- pg_stat_statements · explain
Refactor
- Strangler-fig · branch-by-abstraction
- AST codemods (jscodeshift)
- Modular monolith → services
- Anti-corruption layer
Test
- Playwright · Cypress
- Vitest · Jest · pytest
- Contract (pact)
- Property-based (fast-check, hypothesis)
Observe
- OpenTelemetry · Tempo · Jaeger
- Grafana · Honeycomb
- Sentry · Rollbar
- Log-based golden signals
Adjacent disciplines
Where refactoring connects
DevOps & Cloud Infrastructure
Pipeline parallelism, right-sized infra and cost guardrails — the operational lever behind most performance wins.
QualityQA & Release Governance
The test harness and release gates that make a refactor safe to ship.
ProductSaaS Product Development
When refactoring is part of a broader product rebuild under a single delivery contract.
SecurityCyber Security & Risk Ops
Legacy upgrades that retire known-CVE dependencies, harden auth and re-map access policies.
Change the shape without changing the business
Share the repo (under NDA), the pain and the budget envelope. We come back with an audit report, target metrics and a strangler-fig plan inside ten working days.