cleaning up the javascript and views