Some refactor on client side