Refactoring dependency injection registry