Impurity redistribution during epitaxial growth