improve panel remote ws client side code