refactoring package manager stuff