Simplified logic for readability.