dependency injection helper inspired by Angular DI