[Issue #366][updating] splitted a js method into 2