Removing discontinuities (factoring)