More code cleanup
Merge pull request #75 from wilsonge/feature-ajax

More PHP code cleanup