Practicing refactoring and tests