refactor calculate_risk_actual