implement dependency injection for controlling outcomes