Better subscription algorithm

and authorized clients can be added via the config file