Refactoring package dependencies