I often find myself doing more refactoring than typing new code. and believe it is key to proper codebase evolution.
Martin Fowler, if you have not heard his name before, is a demi-god to java developers, oop expert (perhaps “the” expert) and king of refactoring.
He’s just published a javascript refactoring article where he takes a small function and introduces 4 different refactoring paths.
Enjoy!