refactor deploy.py