encapsulation of factory.objects, pack and unpack improvements