another method (than the change globals to parameters way) is to create an object which stores regularly used functionality and data from your programs. Naturally, this assumes that the coder may have repeated code all over the place.
You can then add this 'functionality object' to all your parameters or make it 'our' as you see fit. Call the accessor methods as required and generally make the program a bit smaller.
I'm not saying this is the best way but if I were presented with a long and badly written program I'd look to simplify it a little. You are essentially re-writing it anyway.