Functional Programming Exercise: Refactoring

Hello, I am stuck with this particular exercise, and I need better explanation. Here is the link

What part are you stuck on or confused by? What have you tried? What tests are failing?