I spent 2000-2015ish as a Perl programmer, which meant I spent most of that time working for a small number of e-commerce and SaaS companies who had large codebases that had mostly been written around 2005 with some hair-raising tech practices. Nursing a nasty codebase to health bit by bit can be very rewarding.
As long as you don't have pressure to just ship X Y Z as you are doing it, in a team of 20 so any nursing you do is quickly undone by the team and its pressure to ship some half thought out feature.