After recently joining a new company this was one of my big contributions, I went through the whole codebase and removed legacy/unused code, or merged code that was slightly different into a more general version.
Spent a good 2 weeks on this but the result was around 120 files changed and over 4000 lines removed, it felt great! And it was also an amazing opportunity to understand the codebase and ask the right questions to other team members when figuring out what was outdated and what wasn't.