we shall not duplicate this .... Try to refactor in such away that the logic must be common for server and client side