deploy.py: small refactor