Transforming Cartesian Position Operators into Spherical Coordinates Context: (not asking for solution)

I'm attempting to show $\langle n,l',m'|\hat z|n,l,m \rangle = 0$ for $m\neq m'$ using the explicit form of $Y_{l,m}(\theta,\phi)$.

Question:
I wasn't sure how to handle the position operator $\hat z$, so my idea was to express it in spherical coordinates.
It is not clear to me if I'm allowed to do something like $\hat z = \hat r \cos(\theta)$
Do position operators work like this?
 A: You can write $z$ as 
$$ z = r\left(\frac{4\pi}{3}\right)^{1/2} Y_{1,0}(\theta,\phi) $$
This amounts to evaluating the matrix element in the following way
$$ \langle n\;l^\prime m^\prime | z | nlm\rangle = \sqrt{\frac{4\pi}{3}}\int R_{n^\prime l^\prime}(r)R_{nl}(r)r^3\,dr\int Y_{l^\prime m^\prime}(\theta, \phi)Y_{10}(\theta, \phi)Y_{lm}(\theta, \phi)\,d\Omega$$
I carried out the full calculation just to give an idea of how to evaluate this integral in the case of linear polarization on the $z$ axis.

 Since we are only interested into the projection of the angular momentum, we just have to consider the part of the spherical harmonics which depends upon $m$. This part, in the integral, is given by the product of the three exponential factors of the three spherical harmonics which depend on $\phi$, so $$ Y_{l^\prime m^\prime}Y_{1q}Y_{lm} \propto e^{-im^\prime \phi}e^{iq\phi}e^{im\phi}$$ in our case $q=0$. The integral in $\phi$ is non-vanishing only when $m^\prime = m+q$ which in our case amounts as saying that the integral is non-vanishing only is $m^\prime = m$

