Most of this could go in BaseCD, you just need to introduce something like a get_negative_samples method for it to call, and then CD generates the samples from the data and PCD generates them from the persistent chain.