Refactor 2 new lines exit criteria.