code cleanup in unpack/