Code factorization