some case changes and profiler fix, though not complete yet