if local variable `isCase` is used only once here, could we simply replace it with the function call?