Creating the factories up front means that we will only create them once, instead of on every change. This allows the factories to potentially store data across the entire query lifespan making caching in the factories effective. Change-Id: Ibc96a754f9c21b21b131d68636274c8231df30cc