Refactor the javascript