Xero Interview Question

Refactor this code? (zip file)