refactor update-scripts.py