replace case by if