When working with legacy code, the first and safest step (after testing and automating tests) is to format your code to make it readable. With some procedures---especially the basic CRUD procedures---that will be enough right there and you can pat yourself on the back for a job well done. But let's suppose that we have…