Pay off technical debt when you implement a story, if you can.
Swarm to start and finish a story. This will help you avoid and pay off debt.
Write more tests to expose the debt, so no one is surprised in the future.
Expose the debt by creating a debt backlog so the debt can be ranked in preparation for iteration planning.
When planning an iteration, take the top item off the debt backlog. Do pairwise comparison of that item with the top item on the feature backlog. Which item has more value? Put that item on the iteration backlog. Continue until the team says, “Stop, we cannot do more in this iteration.”
Your very last solution is rearchitecting. Why? Because it prevents you from making progress in the project. Read Startup Suicide – Rewriting the Code. It’s not just suicide for startups.
(Full Story: Large Technical Debt, Small Project)