Refactor files and format all js to be similar formats