Factorize Code