Refactored triplet.generate to make approximate cleaner