simplify  if block