Show that the group $G$ is of order $12$ I am studying some exercises about semi-direct product and facing this solved one:

Show that the order of group $G=\langle a,b| a^6=1,a^3=b^2,aba=b\rangle$ is $12$.

Our aim is to show that $|G|\leq 12$ and then $G=\mathbb Z_3 \rtimes\mathbb Z_4=\langle x\rangle\rtimes\langle y\rangle$. So we need a homomorphism from $\mathbb Z_4$ to $\mathrm{Aut}(\mathbb Z_3)\cong\mathbb Z_2=\langle t\rangle$ to construct the semi-direct product as we wish: $$\phi:=\begin{cases} 1\longrightarrow \mathrm{id},& \\\\y^2\longrightarrow \mathrm{id},& \\\\y\longrightarrow t,& \\\\y^3\longrightarrow t, \end{cases}
$$ Here, I do know how to construct $\mathbb Z_3 \rtimes_{\phi}\mathbb Z_4$ by using $\phi$ and according to the definition. My question starts from this point:
The solution suddenly goes another way instead of doing $(a,b)(a',b')=(a\phi_b(a'),bb')$. It takes $$\alpha=(x,y^2), \beta=(1,y)$$ and note that these elements satisfy the relations in group $G$. All is right and understandable but how could I find such these later element $\alpha, \beta$?? Is really the formal way for this kind problems finding some generators like $\alpha, \beta$? Thanks for your help.
 A: The subgroup $A$ generated by $a^2$ is normal and order 3. The subgroup $B$ generated by $b$ is of order 4. The intersection of these is trivial so the product $AB$ has order 12. So $G$ has order at least 12. To show it has order 12, we need to see that $a\in AB$; but $b^2=a^3=a^2a$ so $$a=a^{-2}b^2\in AB.$$ Thus the group is the semidirect product of $A$ by $B$ where $$ba^2b^{-1}=(ba)(ab^{-1})=a^{-1}(ba)b^{-1}=a^{-1}(a^{-1}b)b^{-1}=a^{-2}$$
A: $aba=b$ implies that $bab^{-1}=a^{-1}$, hence $bab^{-1}a^{-1}=a^{-2}$; it follows that $G'\supseteq \langle a^{-2}\rangle\cong \mathbb{Z}_3$. Also,
$b^{-1}a^2b=(b^{-1}ab)^2 = (b^{-1}aba.a^{-1})^2=(b^{-1}.ba^{-1})^2=a^{-2}\in \langle a^2\rangle$. 
Hence $\langle a^2\rangle$ is normalised by both $b$, and $a$; $\langle a^2\rangle\triangleleft G$. Then $G/\langle a^2\rangle=\langle \bar{a},\bar{b}\colon \bar{a}^2=1, \bar{b}^2=\bar{a}, \bar{b}\bar{a}\bar{b}^{-1}\bar{a}^{-1}=1\rangle  = \langle \bar{b}\colon \bar{b}^4=1\rangle \cong \mathbb{Z}_4$.
Hence $G'=\langle a^2\rangle\cong \mathbb{Z}_3$, and $G/G'\cong \mathbb{Z}_4$. 
Further $aba=b$ implies $abab=b^2$, i.e. $(ab)^2=b^2=a^3$. Therefore, $(ab)^4=(a^3)^2=1$, and $(ab)^2\neq 1$; hence $\langle ab\rangle$ is cyclic subgroup of $G$ of order $4$, and clearly, it should intersect trivially with $G'$ (compare orders). Hence $G=G'\rtimes \langle ab\rangle \cong \mathbb{Z}_3\rtimes \mathbb{Z}_4$.
...........................................................
To construct semidirect product of $\mathbb{Z}_3=\langle x\rangle$ by $\mathbb{Z}_4=\langle y\rangle$, note that $y$ acts on $\langle x\rangle$ by conjugation, and hence $y^{-1}xy\in \{x,x^2\}$. If $y^{-1}xy=x$, then $G$ will be abelian, and if $y^{-1}xy=x^2$, then $G$ will be the non-abelian group of order 12 (it is different from $D_{12}$, and $A_4$; why?).
