Extensive refactoring of Monomial