Move negotiator code into separate module