Move some code around and add in newrelic deployment event integration