Use Python sets instead of conditional continues