Reorganized some code in the PHP renderer generator's optimizer