Refactoring a very old project in Ruby