Replace IO#lines with IO#each_line