refactoring new relic code