DiffFactorizer: factorize some code