clean the script a little bit