1. Trigonometry (cos)

Show $cos \theta + cos (\theta + \alpha) + cos (\theta + 2\alpha) = (2 cos \alpha + 1) cos (\theta + \alpha)$

$cos \theta + cos (\theta + \alpha) + cos (\theta + 2 \alpha)$
$=[cos (\theta + 2 \alpha) + cos \theta] + cos (\theta + \alpha)$
$=2 cos (\theta + \alpha) cos \alpha + cos (\theta + \alpha)$
$=(2 cos \alpha + 1)cos (\theta + \alpha)$

My question is what happen between this step?
$=2 cos (\theta + \alpha) cos \alpha + cos (\theta + \alpha)$
$=(2 cos \alpha + 1)cos (\theta + \alpha)$

2. $cos(\theta + \alpha)$ was factored out.

I wanna know the formula between $=2 cos (\theta + \alpha) cos \alpha + cos (\theta + \alpha)$
$=(2 cos \alpha + 1)cos (\theta + \alpha)$ how were they factorised?