I know this routine… decipher, decouple, rewrite (portions), and etcetera. Then may be you can make a minor change without breaking something else. Remember this mantra: “Life is wonderful”, just keep repeating through your gritted teeth until your jaw unclenches and you can concentrate once more.
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra