refactoring for TDD.