Separate Client functionality from Server. Rewrite RemoteCalculator sample in that fashion.