packages refactoring