When you start a new job or contribute to an existing code base you often have to dig to find where to make changes. Every time I do this I start thinking “I wouldn’t have done that” or “how does this work?” but it’s important to recognize I don’t have the limitations or knowledge the original creators had at the time.
Everything builds on the past and you can’t be dismissive of what appears to be a bad decision with hindsight. Every day we’re making equally bad decisions that appear correct with our current context and knowledge. Be kind to yourself and those who came before you.