Check for the toggle first to avoid extra processing