Refining code that only worked in the lose world of JavaScript.  There is still more refining to do.