Implement connect and disconnect