cleaning up the js a little bit