redesign js API, obj=>cname