Refactor simplify method.