Better dependency injection for tests.