improve the script and test