refactor test  case