Simplyfying the if statement