More refactoring and webprofiler integration