Second commit: Factorization class and tests