Clean and factorize