Refactor ScalarElem's unpacking.