Mollie interview question

Q: how to improve the code ?