moved connection handling to the service from the ConnectionHandler class