In the last chapter, we solved a tough cross-browser problem, and we left a complete mess in our wake. Now it’s time to clean it up. We start a new chapter about fixing bad code: adding tests, analyzing problems, and refactoring to a better design. We start with a review of where we’re at, how to deal with bad code in general, and look at our problem code.