[CS] Reduce duplication in attribute validators