Remove packOutputs function and clean resetHistory.