total refactor - general ClientState browser client