Simplify if-statement