lambda method to extract first line from text
small pep fixes