refactored js files out of the html and into meaningful files
refactored