improved the simplify scripts