move validation functions in cxtype header