Klaviyo interview question

I was asked to refactor a webhook handler