profiler refactor