Clean up negotiation code