Refining opstack and token code