How to calculate the differential cross section in the center-of-mass frame for a process $AB \rightarrow CD$? I'm trying to do Exercise 4.2 in Halzen, Martin's "Quarks and Leptons"

In the center of mass frame for the process $AB \rightarrow CD $, show that
$$\begin{array} { c } { d Q = \frac { 1 } { 4 \pi ^ { 2 } } \frac { p
 _ { f } } { 4 \sqrt { s } } d \Omega } \\ { F = 4 p _ { i } \sqrt { s } } \end{array}
$$
and hence the differential cross section is
  $$\left. \frac { d \boldsymbol { \sigma } } { d \Omega } \right| _ { \mathrm { cm } }= \frac { 1 } { 64 \pi ^ { 2 } s }\frac { p _ { f } } { p _ { i } } |\mathrm{M}|^2$$

Here $dQ$ is the Lorentz invariant phase space factor
$$d Q = ( 2 \pi ) ^ { 4 } \delta ^ { ( 4 ) } \left( p _ { C } + p _ { D } - p _ { A } - p _ { B } \right) \frac { d ^ { 3 } p _ { C } } { ( 2 \pi ) ^ { 3 } 2 E _ { C } } \frac { d ^ { 3 } p _ { D } } { ( 2 \pi ) ^ { 3 } 2 E _ { D } }$$
So in the solution, they said:
$$\begin{aligned} d Q & = \frac { 1 } { 4 \pi ^ { 2 } } \frac { d ^ { 3 } p _ { C } } { 2 E _ { C } } \frac { d ^ { 3 } p _ { D } } { 2 E _ { D } } \delta ^ { ( 4 ) } \left( p _ { A } + p _ { B } - p _ { C } - p _ { D } \right) \\ & = \frac { 1 } { 4 \pi ^ { 2 } } \frac { d ^ { 3 } p _ { C } } { 2 E _ { C } } \frac { 1 } { 2 E _ { D } } \delta \left( E _ { A } + E _ { B } - E _ { C } - E _ { D } \right) \end{aligned}$$
I do not understand this step at all! Can anyone tell me how they derive it like that? Thank you!
 A: You're supposed to find the differential cross-section for the process $AB 
\rightarrow CD$ in the center-of-mass frame. As you have mentioned,
\begin{align}
dQ =(2\pi)^4 \delta^{(4)}(p_C+p_D-p_A-p_B)\frac{d^3\mathbf{p}_C}{(2\pi)^3 2E_C}\frac{d^3\mathbf{p}_D}{(2\pi)^3 2E_D} \\
\end{align}
Here, the role of the 4-momentum dirac delta function is to ensure 4-momentum conservation in the final calculation. Now, separating the energy and 3-momentum delta functions,
\begin{align}
dQ = \frac{1}{4\pi^2} \frac{1}{4 E_C E_D}\delta(E_C+E_D-E_A-E_B)\delta^{(3)}(\mathbf{p}_C+\mathbf{p}_D-\mathbf{p}_A-\mathbf{p}_B) d^3\mathbf{p}_C d^3\mathbf{p}_D.
\end{align}
By choosing the CM frame, we made the restriction that $\mathbf{p}_B = -\mathbf{p}_A$. However, this choice doesn't make any restriction on $\mathbf{p}_C$ and $\mathbf{p}_D$. As of now (i.e., before the integration over phase space), they are still integration variables. So,
\begin{align}
dQ & = \frac{1}{4\pi^2} \frac{1}{4 E_C E_D}\delta(E_C+E_D-E_A-E_B)\delta^{(3)}(\mathbf{p}_C+\mathbf{p}_D) d^3\mathbf{p}_C d^3\mathbf{p}_D.
\end{align}
But finally when we do the integration over the phase space to obtain the cross-section $\sigma$, the integration over $d^3\mathbf{p}_D$ along with the delta function $\delta^{(3)}(\mathbf{p}_C+\mathbf{p}_D)$ in the integrand vanish together implying $\mathbf{p}_D = -\mathbf{p}_C$ (ensuring 3-momentum conservation). Considering this, we can write   
\begin{align}
dQ & = \frac{1}{4\pi^2} \frac{1}{4 E_C E_D}\delta(E_C+E_D-E_A-E_B) d^3\mathbf{p}_C.
\end{align}
