factory now also holds an internal instance cache by tableName and not only by id.
This saves some more DB queries during execution.