Some thoughts about making an explicit editing pass on working code:
Once you get a piece of code to the point where you believe it works – it’s passing its tests – go back over it and edit it. That is, go back and edit it for clarity, flow, and style. Just as if it were an essay.