Introducing dependency injection (advanced approach)