moving the js scripts to separate files