Completely restructured profiler code cutting all the unused code