improved get_line performance