Rewrite logic based of Webprofiler