Refactoring for unit tests (1).