splitted this into a pure server part, and individual connections