working entityfactory for most classes