An example of methodology to test and then refactor some legacy code