refactoring packages.el