in reply to Got's to be a better way

Here are a few pointers to get you on your way: The whole XP programming thing would love this task. The XP way would be to write a load of tests so that you know the code works and then to start changing the code - testing as you go. As long as the test still work then the code is good.

You might like this article: http://www.perl.com/pub/a/2003/10/09/refactoring.html.

--tidiness is the memory loss of environmental mnemonics