Avoiding impurity accumulation is a requirement for steady-state stellarator operation. The accumulation of impurities can be heavily affected by variations in their density on the flux-surface. Using recently derived semi-analytic expressions for the transport of a collisional impurity species with high-Z and flux-surface density-variation in the presence of a low-collisionality bulk ion species, we numerically optimize the impurity density-variation on the flux-surface to minimize the radial peaking-factor of the impurities. These optimized density-variations can notably reduce the peaking-factor in the Large Helical Device (LHD) case considered here, but have only a minor effect on the peaking-factor in a Wendelstein 7-X (W7-X) standard configuration case, where the peaking-factor already is negative in the core plasma. On the other hand, when the same procedure is used to find density-variations that maximize the peaking-factor, the peaking-factor is notably increased compared to the case with no density-variation. This highlights the potential importance of measuring and controlling these variations in experiments.