Reorganize common Deployment code.