cleaned up client side js a little