removes duplication in readerUnpickleHelper codegen