Question d’entretien chez Xero

How could this code be restructured? Where would you want unit test coverage? etc