Restructured folders and improved the .js file