Refactored GetLatestSnapshotId