Refactored the deploy process