chained if statement to one-liner