Allow any object to be a factory

Change-Id: Ia2607ae3630a6fd31b9be91cc9a3d4f0928e9242