An alternative approach is to build up a container just to resolve each of the instances you are creating below. The main advantage is to remove the hardcoded setup.