snapshot: break out FilterLatestPackages to its own function