refactor(benchmark): reduce code redundancy for statistics calculations