user type unpacking implemented, unpack code reorganized