At one of my previous jobs, we spent more time doing multiple rounds of refactoring than building actual features, which is not necessarily a bad thing per se.
The pattern is to find out what you need to fix slowly, put a list together and fix everything folder by folder or microservice by microservice. So, we realised that our logging mechanism was really awful and decided to standardise it. We sat down and decided on a common logging mechanism. We split into groups of two and took one microservice per group and began refactoring them.