Refactoring packages and sources for test cases