Moving the connect functionality to the model.