change condition to one liner