Compressed two if statements into one.