Xero Interview Question

Refactor the piece of code. What is dependency injection?