Refactoring code involves implementing small steps to improve the design of the existing code without changing the functionality.
What happened to “If it ain’t broke, don’t fix it”?
Code has to do more than just work … it also needs to (1) Allow for modification and extension (2) Communicate what it does to the reader. If code doesn’t do these things, then it is "broke" and needs fixing.
An indication that something is wrong with the code (Examples: use of statics, variables with wide scope,
long methods, big classes, empty catch clauses, comments, and more). Code smells should be targeted when refactoring
as they indicate problem areas that need attention.
Bryant Smith has converted Martin Fowler's refactoring example to C#.
Refactoring in C#