code cleanup php stage 1
code cleanup php stage 2