Version 1 of refactoring sample with tests