Broke out js code inot profiler.js