improving client side auth