Code Optimization

CReate a JS for all javascript files and I reorder the code a bit,
still looks terrible, good luck  =)