Designing dependency injection