Code cleanup/refactor for ctdbp_cdef_cp.