Here is code from [language/framework] that is hard to maintain: ``` [paste code] ``` Goals: [readability, performance, testability]. 1. List the problems you see, most important first. 2. Propose a refactor in small steps that keep behavior the same. 3. List tests I should write before changing anything. 4. Show the refactored code for step 1 only.