Move JavaScript into seperate files.