Updated profiler and cache code