refactoring deploy script