Improved server / client communication logic