refactor perf formula