Refactor without changing behaviour: split oversized functions, remove duplication, replace magic numbers and strings with named constants, break deep nesting with guard clauses, move logic into the domain as value objects, replace type-switches with strategy or polymorphism, and add characterization tests to untested legacy code. Use when the user says "refactor this", "clean this up", "extract a function", "reduce complexity", "this code is a mess", or when a module needs a better cc-scan or arch-scan score.