rewrite kind test