Allow any object to be a factory

Change-Id: I8b047568e48588af36ece21cd194fe19d61d783c