Refactoring is the process of changing the structure (or design) of code without changing the function. See these interesting references for discussions about refactoring.
http://www.wikipedia.org/wiki/Refactor
http://ootips.org/refactoring.html
http://www.exciton.cs.rice.edu/comp410/books/refactoring.html
http://emw.inf.tu-dresden.de/de/pdai/Forschung/refactoring/refactoring_html/node26.html
Packages
One common approach for refactoring Tcl code is to repackage groups of functions into namespaces and packages. This modularization can improve the code maintainability, and it is very easy to do. See How to build good packages, and the cannonical reference by Will Duquette http://www.wjduquette.com/tcl/namespaces.html