"The main goal of software engineers is to solve the problem not to write code" - Dave Farley
Many of my colleagues frequently wind up developing code that only computers can comprehend and fail to empathise with their coworkers. Aim to develop code that is not just machine-readable but also human-readable. These are referred to as "code smells." The same way that anything that rots and smells unpleasant invites bugs so does code. You must clear up the mess as quickly as possible because otherwise it will decay and damage the excellent ones as well.
There are several approaches to understanding code odours and cleaning them. I strongly advise you to read https://users.csc.calpoly.edu/jdalbey/305/Lectures/SmellsToRefactorings.
Update your code as much as possible, simplify it, and make it comprehensible. Make it adaptable.