refined deploy.rb