Is hard to understand why are you creating a given resolver factories in each case, may be that could be improved if the creation is extracted into a separated method