Refactoring of simplifyL