Refactor around Backtrace_counter.trace_func