Refactor deploy.rb