JS cleanup

A small cleanup of our JavaScript code.