Refactor for better profiling result