move client-server specific logic to helper classes