Question d’entretien chez Medallia

How would you advise simplifying this code?