Made main.js more readable