Packages refactoring