Refactor TestForKind