small RPN example refactor