Refactoring a bunch of code. Easier to assess results