Moved JS to JS file