Cleaned up the JS and tpl files