refactoring deploy.rb