change command options; refactor codes