Write same code on client and server. At last.