Refactoring and one more JUnit test.