Misc refactorings in preparation for the new opcode.