Refactored the profiler module