Cleaning up the js a bit.