Refactor script, add new options am: ef3baf689b
am: 9d51e7becd

Change-Id: I3cbf99bf0482d1f3e322b90da6683e36741b0ca4