refactored DD and RL