Let $q_1, q_2, q_3 \in \mathbb{Z}[x,y]$ such that $q_1, q_2$ are algebraically independent and let $S$ be an algebra generated by $q_1, q_2, q_3$ over $F_p$. If writing $S$ as a module over $F_p [q_1, q_2]$ gives $S =F_p [q_1, q_2] \oplus F_p [q_1, q_2] q_3$, then can we say that the algebra $A$ which is generated by $q_1, q_2, q_3$ over $\mathbb{Z}$ can be written, as a module over $\mathbb{Z} [q_1, q_2]$, as $A =\mathbb{Z} [q_1, q_2] \oplus \mathbb{Z} [q_1, q_2] q_3$? If we have the $p$-adic integers instead of integers, does it give the same answer?
Thank you