shorten if condition