added Wordpress and JS hook and did a minor code cleanup