Refactoring is, by definition, modifying the structure of the code without modifying its behavior. Safe refactoring includes variable injection, method extraction, and so on. Unsafe refactoring would affect the architecture of the code, the way the code interacts with the rest of the system, and more. By having a fully tested section of code, you can now modify the architecture and be assured that this section still does what it is supposed to do.