Test factorization and simplification