Better sorting of the package info
Slight refactoring