rpn: simplify code