I would prefer this inside the general logic, and for it to be used for both client-online and server-online cases.