Do we want to impose a sort order here? If not, we can probably simplify the end part to `.toSet.take(limit)`