Improved a few php snippets and removed some unused ones