  Given an affine algebra $R=P/I$, where $P=K[x_1,\dots,x_n]$ is a polynomial
ring over a field $K$ and $I$ is an ideal in $P$, we study re-embeddings of the
affine scheme ${\rm Spec}(R)$, i.e., presentations $R \cong P'/I'$ such that
$P'$ is a polynomial ring in fewer indeterminates. To find such re-embeddings,
we use polynomials $f_i$ in the ideal $I$ which are coherently separating in
the sense that they are of the form $f_i= z_i - g_i$ with an indeterminate
$z_i$ which divides neither a term in the support of $g_i$ nor in the support
of $f_j$ for $j\ne i$. The possible numbers of such sets of polynomials are
shown to be governed by the Gr\"obner fan of $I$. The dimension of the
cotangent space of $R$ at a $K$-linear maximal ideal is a lower bound for the
embedding dimension, and if we find coherently separating polynomials
corresponding to this bound, we know that we have determined the embedding
dimension of $R$ and found an optimal re-embedding.
