Clean up simplification code