Technical debt refers to design decisions that are suboptimal or incorrect, accruing debt that must be paid back later. It includes code debt from violations of coding standards and design debt from design smells or violations of architecture rules. Refactoring is restructuring code without changing behavior to improve design quality and make future changes easier. A variety of tools can help explore code structure and detect technical debt to prioritize refactoring.