Updated profiler to facilitate for testing