Class and package refactoring with unit tests.