Refactoring module profiler to remove redundent code
Synchronising historypx's hisstory length with the default one