Refactored to work on newrelic_plugin 1.3.x