device: Combine two if statements with identical outcome