refactored kpi