Simplify list packages logic