As you work in a legacy codebase what will have the greatest impact over time that will improve the quality of the codebase?

* Remove unused code
* Remove duplicated code
* Add unit tests to improve test coverage where coverage is low
* Create consistent formatting across files
* Update 3rd party software
* Reduce warnings generated by static analysis tools (i.e.Findbugs)

The codebase has been written by many developers with varying levels of expertise over many years, with a lot of areas untested and some untestable without spending a significant time on writing tests.