Let $f=f(T) \in \mathbb{C}[x,y][T]$ be a monic irreducible polynomial: $f=T^n+a_{n-1}T^{n-1}+\cdots+a_1T+a_0$, $a_j \in \mathbb{C}[x,y]$, $0 \leq j \leq n-1$.

Denote $B=\mathbb{C}[x,y,T]/(f)=\mathbb{C}[x,y][w]$, where $w^n+a_{n-1}w^{n-1}+\cdots+a_1w+a_0=0$.

Of course, $\mathbb{C}[x,y]$ is a UFD; however, it seems that $B$ does not have to be a UFD (for example, if $f=T^2-xy$, then $B$ is not a UFD, since $w^2=xy$).

(1) Is it possible to find a general form of $f$, for which $B$ is a UFD?

(2) What happens if we do not assume that $f$ is monic? (I guess being monic may yield a nicer answer?).

(3) It seems (at least to me) that the answer of Ben Webster to this question is relevant.

Perhaps relevant questions are the following: 1 and 2 (which asks when a quotient of a UFD is a UFD).

Thank you very much!