Refactoring can be very complex, time consuming, and can lead to disruption in the release cycles. It should therefore be handled with care and tested thoroughly.
When applications have big pieces of legacy code, the question often rises of where to start and when to implement the methodology, as discussed in this book.
A simple rule is to leave the objects that you touch in better condition than when you started working on them. This rule, however, conflicts with the rule of only refactoring without changing the application.
Refactoring can lead to errors that did not exist before. Making mistakes is what makes us human. Refactoring should therefore never be done as a part of bug fixing.