Rework using itertools