LPS-38301 Improve the legibility of the logic avoiding use conditional breaks and remove unnecesary statement