refactor instrumentation