Extracted the JavaScript code to their own files for readability