Reworking folder structure + redone main.js to separate the functionality into distinct parts