Refactored: Extracted method to reduce complexity.
Refactored: Renamed variables for clarity.
Refactored: Extracted method to reduce complexity.
Implemented: Set item subtraction.
Refactored: Replaced duplicity check by new Set call.
Refactored: Extracted complex condition into method.