Figuring out dependency resolving for factories