break out some of the js code into another file.