Refactoring and Unit Test, step-by-step.