Simplified and improved the pre/postprocessing code for module monomial ordering.