refact script cmd