improve extract-ms script