refactoring with a couple of tests.