Why don't we implement this in ccode directly?