refactor conditionType