Surely for the sake of coherence and elegance those parts should be extracted. Huge advance and benefit for everyone if small bits can be extracted checked carefully and add to a lean library for everyone to use. It should make all future proofs shorter.
However it also sounds like it’s long because it contains huge amounts of repetition and slop, as evidenced by the way it is shrinking.
I mean that's what I see daily. Not uncommon to see multi-thousand lines monsters when a fraction of that would be sensible