a little JS cleanup