Refactor dd cmd