Remove unnecessary package and sort modules.