kind checking
some refinement