More functional approach to consume lines from buffered reader