improve regExp for lines/ some refactor