JS extracted
JS divided into functions