Use \ifcsundef insread of \@ifundefined as it is faster and does not create any new entry in the constrol sequence hash table