# Help with understanding equation for parameter in linear regression

My question directly relates to one that has already been answered - here: Expected Value and Variance of Estimation of Slope Parameter $\beta_1$ in Simple Linear Regression

However, there is an initial step in the derivation which I don't understand which the proof and the textbook I am reading also just assumes.

The equation for $\hat{\beta_1}$ as a result from the normal equations is:
$\hat{\beta_1}=\sum_i(x_i−\bar{x})(Y_i−\bar{Y})/\sum_i(x_i−\bar{x})^2$

However, when we get to deriving the variance of $\hat{\beta_1}$ we get to this expression (written better on the previous question above):

$\hat{β}_1=\sum_i(x_i−\bar{x})(Y_i−\bar{Y})/\sum_i(x_i−\bar{x})^2=\sum_i(x_i−\bar{x})Y_i/S_{xx}$

My main question is what happened to the $\bar{Y}$ in the numerator? What is happening here?

Consider: $\sum_i(x_i−\bar{x})(Y_i−\bar{Y})$
• take multiplicative constants (/things that don't change with $i$) outside the sum in the 2nd term