Use only one condition instead of two nested ones