minor refactor of profiler