Refactor out first and last opcode stripping